package com.xxx.modules.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xxx.modules.mapper.SeveMapper;
import com.xxx.modules.entity.Seve;
import com.xxx.modules.service.SeveService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import java.util.List;
import java.util.Arrays;
import com.xxx.modules.utils.TimeUtil;

/**
 * seve
 *
 * @author 北易航
 * @since 1.0.0 2023-02-05
 */
@Service
public class SeveServiceImpl extends ServiceImpl<SeveMapper, Seve> implements SeveService {

    @Autowired
    private SeveMapper seveMapper;


    @Override
    public PageInfo<Seve> selectSeveInfo(Seve seve, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        QueryWrapper<Seve> wrapper = new QueryWrapper<>();
        List<Seve> data = seveMapper.selectList(wrapper);
        return new PageInfo<>(data);
    }

    @Override
    public void saveSeveInfo(Seve seve) {
        seveMapper.insert(seve);
    }

    @Override
    public void updateSeveInfo(Seve seve) {
        seveMapper.updateById(seve);
    }

    @Override
    public void delSeveInfo(Integer id) {
        seveMapper.deleteById(id);
    }

    @Override
    public void delBatchSeveInfo(String idList) {
        List<String> list = Arrays.asList(idList.split(","));
        seveMapper.deleteBatchIds(list);
    }


}